package com.vogue.supplymall.shop.domain.dao;

import com.vogue.supplymall.common.domain.dto.SearchInfo;
import com.vogue.supplymall.shop.domain.model.Shop;
import java.util.List;
import java.util.Map;

/**
 * The type Shop dao.
 */
public interface ShopDao extends BaseDao<Shop, Long> {

    /**
     * Find shop by sql list.
     * 根据自定义sql检索店铺
     *
     * @param searchInfo the search info
     * @return the list
     */
    List<Map<String, Object>> findShop(SearchInfo searchInfo);

    /**
     * 返回记录总条数
     * 
     * @param searchInfo
     * @return
     */
    Long findShopCount(SearchInfo searchInfo);
    
    /**
     * Find shop for sql list.
     * 通过唯一注册号id和对应机构id，得到店铺信息
     *
     * @param sysCodeId the sys code id
     * @param organId   the organ id
     * @return the list
     */
    List<Shop> findShopForSql(Long sysCodeId, Long organId);
    /**
     * 根据matchid和syscodeid找对应的店铺
     */
    public List<Shop> findShopByMS(Long syscodeId,String matchId,int tendId);
    /**
     * 更改门店的隐藏属性
     *
     * @param shopId     the shop id
     * @param sysCodeId  the sys code id
     * @param hiddenFlag the hidden flag
     */
    public void changeHiddenFlagOfShop(Long shopId,Long sysCodeId, int hiddenFlag);

    /**
     * Find shop by sql list.
     * 根据条件检索开通资质的店铺
     *
     * @param searchInfo the search info
     * @return the list
     * @throws RuntimeException the runtime exception
     */
    List<Map<String, Object>> findLicenceShopBySql(SearchInfo searchInfo) throws RuntimeException;

    /**
     * Count valid shop long.
     * admin-business使用，查询所有开通的店铺
     *
     * @return the long
     */
    Long countValidShop();

    /**
     *根据syscodeId更新shop表 是否等待手动接单标记
     * @param syscodeId
     * @param waitingOrder
     */
    public void updateWaitingOrderBySyscodeId(Long syscodeId, int waitingOrder);
}